#ifndef AGTK_FREETYPE_H
#define AGTK_FREETYPE_H

namespace agtk {

class FontData {
public:
	// Constructor.
	FontData(const char* path, unsigned int height, float kerning);

	// Destructor.
	~FontData();

	// Finds the next power of 2 greater than or equal to the integer parameter.
	int NextPowerOf2(int param);

	// Makes and compiles the display list.
	void BuildDisplayList( FT_Face face, char ch, GLuint listBase, GLuint* texBase );

	// Holds the height of the font.
	float m_height;

	// Kerning value. Controls the space between letters in the font.
	float m_kerning;

	// Holds the texture id's.
	GLuint* m_textures;

	// Holds the first display list id.
	GLuint m_listBase;

	// Holds width of each glyph.
	int m_glyphWidths[128];
};

FontData* LoadFont(const char* path, unsigned int height, float kerning = 0.0f);
void Print(FontData* ft_font, float x, float y, const char *fmt, Color &color = Color(1.0f, 1.0f, 1.0f));
int MeasureLength(FontData* ft_font, const char *fmt);
void PushScreenCoordinateMatrix();
void PopProjectionMatrix();

}

#endif